<style>
    .upload-image {
        background: url('__CDN__/assets/addons/example/img/plus.png') no-repeat center center;
        background-size: 30px 30px;
        height: 30px;
        width: 30px;
        border: 1px solid #ccc;
    }
    .upload-images {
        background: url('__CDN__/assets/addons/example/img/plus.png') no-repeat center center;
        background-size: 30px 30px;
        height: 30px;
        width: 30px;
        border: 1px solid #ccc;
    }

    textarea.form-control {
        background: #eee;
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Unit_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-unit_id" data-rule="required" data-source="unit/index" class="form-control selectpage" name="row[unit_id]" type="text" value="{$row.unit_id|htmlentities}">
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Unit_name')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-unit_name" class="form-control" name="row[unit_name]" type="text" value="{$row.unit_name|htmlentities}">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('样品数量')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sample_num"data-rule="required" class="form-control" name="row[sample_num]" type="text"value="{$row.sample_num|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('样品类别')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sample_type"data-rule="required" class="form-control" name="row[sample_type]" type="text"value="{$row.sample_type|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" class="form-control" name="row[phone]" type="text" value="{$row.phone|htmlentities}">
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Producer')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-producer" class="form-control" name="row[producer]" type="text" value="{$row.producer|htmlentities}">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Producer_time')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-producer_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[producer_time]" type="text" value="{:$row.producer_time?datetime($row.producer_time):''}">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Smple_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-smple_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[smple_time]" type="text" value="{:$row.smple_time?datetime($row.smple_time):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Detection_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-detection_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[detection_time]" type="text" value="{:$row.detection_time?datetime($row.detection_time):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-remark" class="form-control" name="row[remark]" type="text" value="{$row.remark|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false"
                                  data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Yimages')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-yimages" class="form-control" size="50" name="row[yimages]" type="text" value="{$row.yimages|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-yimages" class="btn btn-danger faupload" data-input-id="c-yimages" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-yimages"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-yimages" class="btn btn-primary fachoose" data-input-id="c-yimages" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-yimages"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-yimages"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Simages')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-simages" class="form-control" size="50" name="row[simages]" type="text"value="{$row.simages|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-simages" class="btn btn-danger faupload" data-input-id="c-simages" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-simages"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-simages" class="btn btn-primary fachoose" data-input-id="c-simages" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-simages"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-simages"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Detection_json')}:</label>
        <div class="col-xs-12  col-sm-8">
            <table class="table fieldlist" data-template="eventtpl" data-name="row[detection_json]" id="second-table">
                <tr>
                    <td>{:__('样品名称')}</td>
                    <td>{:__('检测项目')}</td>
                    <td>{:__('检测结果')}</td>
                    <td>{:__('检测方法')}</td>
                    <td>{:__('试剂编码')}</td>
                    <td>{:__('备注')}</td>
                    <td width="100"></td>
                </tr>
                <tr>
                    <td colspan="4"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>

            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[detection_json]" style="display: none" class="form-control" cols="30" rows="5">{$row.detection_json}</textarea>
            <script id="eventtpl" type="text/html">
                <tr class="form-inline">
                    <td><input type="text"data-rule="required" size="15"  name="<%=name%>[<%=index%>][sample_name]" class="form-control" value="<%=row.sample_name%>" placeholder="样品名称"/></td>
                    <td><input type="text"data-rule="required" size="15"  name="<%=name%>[<%=index%>][project]" class="form-control selectpage" data-source="project/index" data-field="name" value="<%=row['project']%>" placeholder="检测项目"/></td>
                    <td>
                        <select id="opens"data-rule="required"  class="form-control"  name="<%=name%>[<%=index%>][result]" >
                            <option value="阳" selected>阳</option>
                            <option value="阴">阴</option>
                            <option value="合格">合格</option>
                        </select>
                        <!--                        <input type="text" name="<%=name%>[<%=index%>][result]" class="form-control" value="<%=row.result%>" placeholder="检测结果"/>-->
                    </td>
                    <td><input type="text"data-rule="required" name="<%=name%>[<%=index%>][method]" class="form-control selectpage" data-source="menthod/index" data-field="name" value="<%=row.method%>" placeholder="检测方法"/></td>
                    <td><input type="text"data-rule="required" name="<%=name%>[<%=index%>][name]" class="form-control selectpage" data-source="reagent/index" data-params='{"custom[num]":"0"}'data-field="code" value="<%=row.name%>" placeholder="试剂编号"/></td>
                    <td><input type="text"data-rule="required" size="15"  name="<%=name%>[<%=index%>][remark]" class="form-control" value="<%=row.remark%>" placeholder="备注"/></td>
<!--                    <td><input type="text"data-rule="required" size="15"  name="<%=name%>[<%=index%>][unitmsg]" class="form-control" value="<%=row.unitmsg%>" placeholder="单位"/></td>-->
                    <td>
                        <!--下面的两个按钮务必保留-->
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <!--    <div class="form-group">&ndash;&gt;-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            -->
<!--            <div class="radio">-->
<!--            {foreach name="statusList" item="vo"}-->
<!--            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> -->
<!--            {/foreach}-->
<!--            </div>-->

<!--        </div>-->
<!--    </div>-->

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
